<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="demo">
			<!-- 直接js脚本 -->
			<button v-on:click="count++">{{count}}</button>
			<!-- js方法 -->
			<button v-on:click="greet('abc',$event)">greet</button>
			<input v-on:keyup.enter="submit()" />
		</div>
		<script type="text/javascript">
			var vm = new Vue({
				el: "#demo",
				data: {
					count: 0,
					name: "vue"
				},
				methods: {
					greet: function(str, e) {
						alert("Hi," + this.name + str);
						console.log(e.target.tagName);
					},
					submit:function(){
						console.log("submit()");
					}
				}
			})
		</script>

	</body>
</html>
